package com.boot.main.controller;

import com.rometools.rome.feed.synd.SyndEntry;
import com.rometools.rome.io.SyndFeedInput;
import com.rometools.rome.io.XmlReader;
import com.rometools.rome.feed.synd.SyndFeed;
import java.net.URL;

public class FeedConsumer {
    public static void main(String[] args){
        try{
            String url = "https://www.eallion.com/index.xml";
            try(XmlReader reader=new XmlReader(new URL(url))) {
                SyndFeed feed = new SyndFeedInput().build(reader);
                System.out.println(feed.getTitle());
                System.out.println("***********************************");
                for(SyndEntry entry:feed.getEntries()){
                    System.out.println(entry.getUri());
                    System.out.println(entry.getTitle());
                    System.out.println(entry.getDescription().getValue());
                }
            }
        }catch(Exception e){
            e.printStackTrace();
        }
    }
}
